package com.gosophia.conference.action.confPrepare;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.conferenceManagement.common.dto.DocumentDTO;
import com.gosophia.conferenceManagement.confPreparation.ws.ConfPreparationWebService;
import com.gosophia.oa.action.JudgeCurrentUndertaker;
import com.opensymphony.xwork2.ActionContext;
/**
 * 更新签到表
 * @author wangxinbing
 * @since  2011-3-30
 *  Copyright (c) 2011 Gosophia corporation All Rights Reserved
 */
@Component("UpdateConfSignTableAction")
@Scope("prototype")
public class UpdateConfSignTableAction extends BaseSupportAction {
	@Autowired
	private ConfPreparationWebService confPreparationWebService;
	@Autowired
	private JudgeCurrentUndertaker judgeCurrentUndertaker;
	private Long jobId;
	
	private String onlinePath;
	
	private String onlineVersion;
	@Override
	public String _execute() throws Exception {
		//判断是否匹配,如果不匹配转到异常页面
        judgeCurrentUndertaker.judgeOperationAuthority(jobId);
		DocumentDTO docDTO = new DocumentDTO();
		docDTO.setDocumentVersion(onlineVersion);
		docDTO.setDocumentPath(onlinePath);
		docDTO.setDocumentCategory("online");
		docDTO.setDocumentName("签到表");
		docDTO.setDocumentNote("签到表");
		confPreparationWebService.updateConfSignTable(jobId,docDTO);
		super.getRequestResult().setMessage("保存成功！");
		super.getRequestResult().setRsltCode("0");
		ActionContext.getContext().getSession().put("_lastOpResult",
				super.getRequestResult());
		return SUCCESS;
	}
	public Long getJobId() {
		return jobId;
	}
	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}
	public String getOnlinePath() {
		return onlinePath;
	}
	public void setOnlinePath(String onlinePath) {
		this.onlinePath = onlinePath;
	}
	public String getOnlineVersion() {
		return onlineVersion;
	}
	public void setOnlineVersion(String onlineVersion) {
		this.onlineVersion = onlineVersion;
	}
	
	

}
